package mantenedor.source;
import java.sql.*;
import javax.swing.JOptionPane;
/**
 *
 * @author Demoni <(^o^)>
 */
public class conexion {
    private static Connection con;
    private Statement st;
    private ResultSet rs;
    
    public conexion(){
       open();
    }
  
   
     public void open(){
         try
         {
             Class.forName("oracle.jdbc.driver.OracleDriver");
          // con = DriverManager.getConnection("jdbc:oracle:thin:system/duocadmin@localhost:1521:XE");
             con = DriverManager.getConnection("jdbc:oracle:thin:demoni/demoni@localhost:1521:XE");
             st = con.createStatement();
             con.setAutoCommit(false);
           
         }
         catch(Exception error)
         {
             JOptionPane.showMessageDialog(null, error.getMessage());
         }
    }
    public void cerrar() throws SQLException{
        con.close();
    }
    
}
